#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
	int n = 0;
	double d = 0.0;
	scanf("%d %lf", &n, &d);
	for (int i = 0; i < n; i++)
	{
		d *= 2;
	}
	if (d - (int)d > 0.5)
		printf("%d", (int)d + 1);
	else
		printf("%d", (int)d);
	return 0;
}